package cn.com.utt.common.message;

import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;

public class CommandResp extends Message {
	@JSONField(name="sn") 
	private String sn;
	@JSONField(name="results") 
	private Map<String, String> results;

	public CommandResp() {
		setType(MessageType.COMMANDRESP.toString());
	}

	@Override
	public String encode() {
		return JSON.toJSONString(this);
	}

	@Override
	public void decode(byte[] buf) {
		CommandResp resp = JSON.parseObject(buf, CommandResp.class);
		this.setId(resp.getId());
		this.sn = resp.getSn();
		this.results = resp.getResults();
	}

	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	public Map<String, String> getResults() {
		return results;
	}

	public void setResults(Map<String, String> results) {
		this.results = results;
	}


}
